package router

import (
	"github.com/gin-gonic/gin"
	"github.com/smash-llj/Nexa-server/api"
)

func InitFriendRoutes() {
	//注册当前大模块到gfnRoutes里面
	RegisterRoute(func(rgPublic *gin.RouterGroup, tgAuth *gin.RouterGroup) {
		friendApi := api.NewFriendApi()
		publicFriendRouter(tgAuth, rgPublic, friendApi)
	})
}
func publicFriendRouter(tgAuth, rgPublic *gin.RouterGroup, api api.FriendApi) {
	tgAuth.GET("/reqFriendList", api.RequestFriendList)
	tgAuth.POST("/searchFriend", api.SearchFriend)
	tgAuth.POST("/addFriend", api.AddFriend)
	tgAuth.DELETE("/delFriend", api.DelFriend)
	tgAuth.POST("/agreeFriend", api.AgreeFriend)

	tgAuth.GET("/getFriendList", api.GetFriendList)
	tgAuth.POST("/getMessageList", api.GetFriendMessageList)
	tgAuth.GET("/getFriendDetail/:friendId", api.DetailFriend)
}
